From 41b5a6a900a625771366f3492ac2b9463feabf4b Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Sat, 5 Mar 2011 14:49:19 +0100 Subject: [PATCH] theme: Compute scale values once Use a local variable to store the xscale and yscale, so that it's only computed once. Makes it easier to do the changes I'm about to do. --- gtk/gtkthemingengine.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/gtk/gtkthemingengine.c b/gtk/gtkthemingengine.c index bd32c906a0..2fdec7335a 100644 --- a/gtk/gtkthemingengine.c +++ b/gtk/gtkthemingengine.c @@ -3005,6 +3005,8 @@ gtk_theming_engine_render_activity (GtkThemingEngine *engine, /* transparency is a function of time and intial value */ gdouble t = (gdouble) ((i + num_steps - step) % num_steps) / num_steps; + gdouble xscale = cos (i * G_PI / half); + gdouble yscale = sin (i * G_PI / half); cairo_set_source_rgba (cr, color->red, @@ -3013,11 +3015,11 @@ gtk_theming_engine_render_activity (GtkThemingEngine *engine, color->alpha * t); cairo_move_to (cr, - (radius - inset) * cos (i * G_PI / half), - (radius - inset) * sin (i * G_PI / half)); + (radius - inset) * xscale, + (radius - inset) * yscale); cairo_line_to (cr, - radius * cos (i * G_PI / half), - radius * sin (i * G_PI / half)); + radius * xscale, + radius * yscale); cairo_stroke (cr); } -- 2.30.2